package com.kingdee.eas.xr.helper;

/*jadclipse*/// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.


import java.awt.Component;
import java.awt.Container;
import java.math.BigDecimal;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;

import javax.swing.JComponent;
import javax.swing.JFormattedTextField;
import javax.swing.JPanel;

import com.kingdee.bos.ctrl.extendcontrols.KDBizMultiLangBox;
import com.kingdee.bos.ctrl.extendcontrols.KDBizPromptBox;
import com.kingdee.bos.ctrl.kdf.table.ICell;
import com.kingdee.bos.ctrl.kdf.table.IColumn;
import com.kingdee.bos.ctrl.kdf.table.IRow;
import com.kingdee.bos.ctrl.kdf.table.KDTEditManager;
import com.kingdee.bos.ctrl.kdf.table.KDTable;
import com.kingdee.bos.ctrl.swing.IKDTextComponent;
import com.kingdee.bos.ctrl.swing.KDComboBox;
import com.kingdee.bos.ctrl.swing.KDContainer;
import com.kingdee.bos.ctrl.swing.KDDatePicker;
import com.kingdee.bos.ctrl.swing.KDFormattedTextField;
import com.kingdee.bos.ctrl.swing.KDLabelContainer;
import com.kingdee.bos.ctrl.swing.KDMultiLangBox;
import com.kingdee.bos.ctrl.swing.KDPanel;
import com.kingdee.bos.ctrl.swing.KDScrollPane;
import com.kingdee.bos.ctrl.swing.KDSplitPane;
import com.kingdee.bos.ctrl.swing.KDTabbedPane;
import com.kingdee.bos.ctrl.swing.KDTextArea;
import com.kingdee.bos.ctrl.swing.KDTextField;
import com.kingdee.bos.ui.UIFocusTraversalPolicy;
import com.kingdee.bos.ui.face.CoreUIObject;
import com.kingdee.eas.base.commonquery.CompareTypeEnum;
import com.kingdee.eas.framework.client.CoreUI;
import com.kingdee.eas.util.SysUtil;
import com.kingdee.eas.util.client.EASResource;
import com.kingdee.eas.util.client.MsgBox;
import com.kingdee.util.DateTimeUtils;
import com.kingdee.util.StringUtils;

// Referenced classes of package com.kingdee.eas.ec.common.client:
//            EcZeroBaseRender, EcTableHelper, EcClientHelper

public class EcClientVerifyHelper
{

    public EcClientVerifyHelper()
    {
    }

    public static void verifyInput(CoreUIObject ui, String resourcePath, KDTable kdtEntries, IRow row, int i, String msg)
    {
        if(EcStringHelper.isEmpty(row.getCell(i).getValue()))
        {
            kdtEntries.getEditManager().editCellAt(row.getRowIndex(), i);
            MsgBox.showWarning(ui, EASResource.getString(resourcePath, msg));
            SysUtil.abort();
        }
    }

    public static void verifyInput(CoreUIObject ui, KDTable kdtEntries, String key)
    {
        boolean isShowZero = false;
        if(kdtEntries != null && !StringUtils.isEmpty(key))
        {
            IColumn column = kdtEntries.getColumn(key);
//            if(column != null)
//            {
//                com.kingdee.bos.ctrl.kdf.util.render.IBasicRender basicRender = column.getRenderer();
//                if(basicRender != null && (basicRender instanceof EcZeroBaseRender))
//                    isShowZero = ((EcZeroBaseRender)basicRender).isShowZero();
//            }
        }
        verifyInput(ui, kdtEntries, key, isShowZero);
    }

    public static void verifyInput(CoreUIObject ui, KDTable kdtEntries, String key, boolean isAllowZero)
    {
        IRow row = null;
        for(int j = 0; j < kdtEntries.getRowCount(); j++)
        {
            row = kdtEntries.getRow(j);
            verifyInput(ui, kdtEntries, row, key, isAllowZero);
        }

    }

    public static void verifyInput(CoreUIObject ui, KDTable kdtEntries, String keys[])
    {
        if(EcTableHelper.isNotEmpty(kdtEntries) && EcArrayUtil.isNotEmpty(keys))
        {
            int i = 0;
            for(int len = keys.length; i < len; i++)
                verifyInput(ui, kdtEntries, keys[i]);

        }
    }

    public static void verifyInput(CoreUIObject ui, KDTable kdtEntries, IRow row, String key)
    {
        verifyInput(ui, kdtEntries, row, key, false);
    }

    public static void verifyInput(CoreUIObject ui, KDTable kdtEntries, IRow row, String key, boolean isAllowZero)
    {
        int colIndex = kdtEntries.getColumnIndex(key);
        if(EcStringHelper.isEmpty(row.getCell(key).getValue(), isAllowZero))
        {
            kdtEntries.getEditManager().editCellAt(row.getRowIndex(), colIndex);
            String headValue = "";
            for(int i = 0; i < kdtEntries.getHeadRowCount(); i++)
            {
                if(!"".equals(headValue))
                    headValue = (new StringBuilder()).append(headValue).append("-").toString();
                headValue = (new StringBuilder()).append(headValue).append((String)kdtEntries.getHeadRow(i).getCell(key).getValue()).toString();
            }

            String msg = (new StringBuilder()).append(headValue).append(" ").append(EASResource.getString(path, "CanNotBeNull")).toString();
            msg = msg.replaceAll("#", (new StringBuilder()).append(" ").append(headValue).append(" ").toString());
            MsgBox.showWarning(ui, msg);
            SysUtil.abort();
        }
    }

    public static void verifyAllInput(CoreUIObject ui, KDTable kdtEntries, String keys[], String msg)
    {
        int colIndex = kdtEntries.getColumnIndex(keys[0]);
        String headValue = "";
        IRow row = null;
        for(int j = 0; j < kdtEntries.getRowCount(); j++)
        {
            int flag = 0;
            row = kdtEntries.getRow(j);
            for(int i = 0; i < keys.length; i++)
                if(EcStringHelper.isEmpty(row.getCell(keys[i]).getValue()))
                    flag++;

            if(flag == keys.length)
            {
                kdtEntries.getEditManager().editCellAt(row.getRowIndex(), colIndex);
                MsgBox.showWarning(ui, msg);
                SysUtil.abort();
            }
        }

    }

    public static void verifyInput(CoreUIObject ui, KDTable kdtEntries)
    {
        String columnNames[] = EcTableHelper.getColumnKeysOfRequiredHided(kdtEntries, true, false);
        verifyInput(ui, kdtEntries, columnNames);
    }

    public static void verifyInputIsZero(CoreUIObject ui, KDTable kdtEntries, IRow row, String key)
    {
        int colIndex = kdtEntries.getColumnIndex(key);
        Object obj = row.getCell(key).getValue();
        if((obj instanceof BigDecimal) && ((BigDecimal)obj).floatValue() == 0.0F)
        {
            kdtEntries.getEditManager().editCellAt(row.getRowIndex(), colIndex);
            String headValue = (String)kdtEntries.getHeadRow(0).getCell(key).getValue();
            String msg = (new StringBuilder()).append(headValue).append(" ").append(EASResource.getString(path, "CanNotBeZero")).toString();
            msg.replaceAll("#", (new StringBuilder()).append(" ").append(headValue).append(" ").toString());
            MsgBox.showWarning(ui, msg);
            SysUtil.abort();
        }
    }

    public static void verifyInputIsMaxValue(CoreUIObject ui, KDTable kdtEntries, IRow row, String key)
    {
        int colIndex = kdtEntries.getColumnIndex(key);
        Object obj = row.getCell(key).getValue();
        if(!EcStringHelper.isEmpty(obj) && (obj instanceof BigDecimal) && ((BigDecimal)obj).compareTo(MAX_VALUE) == 1)
        {
            kdtEntries.getEditManager().editCellAt(row.getRowIndex(), colIndex);
            String headValue = (String)kdtEntries.getHeadRow(0).getCell(key).getValue();
            String msg = (new StringBuilder()).append(headValue).append(" ").append(EASResource.getString(path, "CanNotBeZero")).toString();
            msg.replaceAll("#", (new StringBuilder()).append(" ").append(headValue).append(" ").toString());
            MsgBox.showWarning(ui, msg);
            SysUtil.abort();
        }
    }

    public static void verifyEmpty(CoreUIObject ui, KDTable kdtEntries)
    {
        if(kdtEntries == null || kdtEntries.getRowCount() < 1)
        {
            MsgBox.showWarning(ui, EASResource.getString(path, "EntryCanNotBeNull"));
            SysUtil.abort();
        }
    }

    public static void verifyEmpty(CoreUIObject ui, String resourcePath, KDTextField txtNumber, String msg)
    {
        String txt = txtNumber.getText();
        String tooltip = txtNumber.getToolTipText();
        if(txt == null || txt.trim().equals(""))
        {
            txtNumber.requestFocus(true);
            MsgBox.showWarning(ui, resourcePath == null || msg == null ? (new StringBuilder()).append(tooltip != null ? tooltip : "").append(getMessage(txtNumber)).toString() : EASResource.getString(resourcePath, msg));
            SysUtil.abort();
        }
    }

    public static void verifyEmpty(CoreUIObject ui, KDTextField txtNumber)
    {
        verifyEmpty(ui, null, txtNumber, null);
    }

    public static void verifyEmpty(CoreUIObject ui, String resourcePath, JFormattedTextField txtField, String msg, boolean isAbort)
    {
        String txt = txtField.getText();
        if(txt == null || txt.trim().equals(""))
        {
            txtField.requestFocus(true);
            MsgBox.showWarning(ui, resourcePath == null || msg == null ? getMessage(txtField) : EASResource.getString(resourcePath, msg));
            if(isAbort)
                SysUtil.abort();
        }
    }

    public static void verifyEmpty(CoreUIObject ui, JFormattedTextField txtNumber)
    {
        verifyEmpty(ui, null, txtNumber, null, true);
    }

    private static String getMessage(Component component)
    {
        String text = getCompLabelText(component);
        return (new StringBuilder()).append(text).append(EASResource.getString(path, "CanNotBeNull")).toString();
    }

    private static String getCompLabelText(Component component)
    {
        String text = "";
        if(component.getParent() instanceof KDLabelContainer)
            text = ((KDLabelContainer)component.getParent()).getBoundLabelText();
        else
        if(component instanceof KDTextArea)
        {
            Container cont = component.getParent();
            if(cont != null)
            {
                Container cont2 = cont.getParent();
                if((cont2 instanceof KDScrollPane) && (cont2.getParent() instanceof KDLabelContainer))
                    text = ((KDLabelContainer)cont2.getParent()).getBoundLabelText();
            }
        }
        return text;
    }

    public static void verifyEmpty(CoreUIObject ui, String resourcePath, KDBizPromptBox bizBox, String msg, boolean isAbort)
    {
        Object content = bizBox.getData();
        String tooltip = bizBox.getToolTipText();
        if(content == null || content.getClass().isArray() && EcStringHelper.isEmpty(((Object) ((Object[])(Object[])(Object[])content))))
        {
            bizBox.requestFocus(true);
            MsgBox.showWarning(ui, resourcePath == null || msg == null ? (new StringBuilder()).append(tooltip != null ? tooltip : "").append(getMessage(bizBox)).toString() : EASResource.getString(resourcePath, msg));
            if(isAbort)
                SysUtil.abort();
        }
    }

    public static void verifyEmpty(CoreUIObject ui, KDBizPromptBox bizBox)
    {
        verifyEmpty(ui, null, bizBox, null, true);
    }

    public static void verifyEmpty(CoreUIObject ui, KDComboBox comboBox)
    {
        verifyEmpty(ui, null, comboBox, null);
    }

    public static void verifyEmpty(CoreUIObject ui, String resourcePath, KDMultiLangBox multLangBox, String msg)
    {
        Object content = multLangBox.getSelectedItem();
        if(content == null || content.toString().trim().length() <= 0)
        {
            multLangBox.requestFocus(true);
            MsgBox.showWarning(ui, resourcePath == null || msg == null ? getMessage(multLangBox) : EASResource.getString(resourcePath, msg));
            SysUtil.abort();
        }
    }

    public static void verifyEmpty(CoreUIObject ui, KDMultiLangBox multLangBox)
    {
        verifyEmpty(ui, null, multLangBox, null);
    }

    public static void verifyEmpty(CoreUIObject ui, String resourcePath, KDComboBox comboBox, String msg)
    {
        Object content = comboBox.getSelectedItem();
        if(EcStringHelper.isEmpty(content))
        {
            comboBox.requestFocus(true);
            MsgBox.showWarning(ui, resourcePath == null || msg == null ? getMessage(comboBox) : EASResource.getString(resourcePath, msg));
            SysUtil.abort();
        }
    }

    public static void verifyEmpty(CoreUIObject ui, String resourcePath, KDDatePicker datePicker, String msg)
    {
        String content = datePicker.getText();
        if(content == null || content.equals(""))
        {
            datePicker.requestFocus(true);
            MsgBox.showWarning(ui, resourcePath == null || msg == null ? getMessage(datePicker) : EASResource.getString(resourcePath, msg));
            SysUtil.abort();
        }
    }

    public static void verifyEmpty(CoreUIObject ui, KDDatePicker datePicker)
    {
        verifyEmpty(ui, null, datePicker, null);
    }

    public static void verifyDateFromTo(CoreUIObject ui, String resourcePath, Date dateFrom, Date dateTo, String msg)
    {
        dateFrom = DateTimeUtils.truncateDate(dateFrom);
        dateTo = DateTimeUtils.truncateDate(dateTo);
        if(dateFrom.compareTo(dateTo) == 0)
            dateTo = ECDateHelper.getNextDay(dateTo);
        if(dateFrom.compareTo(dateTo) > 0)
        {
            MsgBox.showWarning(ui, EASResource.getString(resourcePath, msg));
            SysUtil.abort();
        }
    }

    public static void verifyEmpty(CoreUIObject ui, String resourcePath, KDFormattedTextField txtNumber, String msg)
    {
        Object txt = txtNumber.getNumberValue();
        if(txt == null)
        {
            txtNumber.requestFocus(true);
            MsgBox.showWarning(ui, resourcePath == null || msg == null ? getMessage(txtNumber) : EASResource.getString(resourcePath, msg));
            SysUtil.abort();
        }
    }

    public static void verifyEmpty(CoreUIObject ui, String resourcePath, KDTextArea txtArea, String msg)
    {
        String txt = txtArea.getText();
        if(txt == null || txt.trim().length() <= 0)
        {
            txtArea.requestFocus(true);
            MsgBox.showWarning(ui, resourcePath == null || msg == null ? getMessage(txtArea) : EASResource.getString(resourcePath, msg));
            SysUtil.abort();
        }
    }

    public static void verifyEmpty(CoreUIObject ui, KDTextArea txtArea, String name)
    {
        String txt = txtArea.getText();
        if(txt == null || txt.trim().length() <= 0)
        {
            txtArea.requestFocus(true);
            MsgBox.showWarning((new StringBuilder()).append(name).append(EASResource.getString(path, "CanNotBeNull")).toString());
            SysUtil.abort();
        }
    }

    public static void verifyEmpty(CoreUIObject ui, KDTextArea txtArea)
    {
        verifyEmpty(ui, null, txtArea, null);
    }

    public static void verifyEmpty(CoreUIObject ui, KDFormattedTextField txtNumber)
    {
        verifyEmpty(ui, null, txtNumber, null);
    }

    public static void checkStringLength(Component ui, String resourcePath, IRow row, String colName, int length)
    {
        String name = (String)row.getCell(colName).getValue();
        if(name != null && name.length() > length)
        {
            MsgBox.showWarning(ui, (new StringBuilder()).append(EASResource.getString(resourcePath, "StringLengthGreaterthan")).append(length).append(":").append("\n\n").append(name).toString());
            SysUtil.abort();
        }
    }

    public static void verifyEmpty(CoreUIObject ui, String resourcePath, Object value, String msg)
    {
        if(EcStringHelper.isEmpty(value))
        {
            MsgBox.showWarning(ui, EASResource.getString(resourcePath, msg));
            SysUtil.abort();
        }
    }

    public static void verifyEmpty(CoreUIObject ui, String resourcePath, Object value, String msg, String ctrlName)
    {
        if(EcStringHelper.isEmpty(value))
        {
            MsgBox.showWarning(ui, EASResource.getString(resourcePath, msg));
            setComponentFocus(ui, ctrlName);
            SysUtil.abort();
        }
    }

    public static void setComponentFocus(JComponent ui, String componentName)
    {
        Component comps[] = ui.getComponents();
        if(comps != null && comps.length > 0)
        {
            for(int i = 0; i < comps.length; i++)
            {
                if((comps[i] instanceof KDPanel) || (comps[i] instanceof KDScrollPane) || (comps[i] instanceof KDSplitPane) || (comps[i] instanceof KDTabbedPane) || (comps[i] instanceof KDLabelContainer) || (comps[i] instanceof KDContainer) || (comps[i] instanceof KDPanel) || (comps[i] instanceof JPanel))
                {
                    setComponentFocus((JComponent)comps[i], componentName);
                    continue;
                }
                if(comps[i] != null && comps[i].getName() != null && comps[i].getName().equals(componentName))
                    comps[i].requestFocus();
            }

        }
    }

    public static void verifyEmptyAndNoZero(CoreUIObject ui, String resourcePath, Object value, String msg)
    {
        if(value == null)
        {
            MsgBox.showWarning(ui, EASResource.getString(resourcePath, msg));
            SysUtil.abort();
        }
        if((value instanceof BigDecimal) && ((BigDecimal)value).compareTo(EcConstant.ZERO) == 0)
        {
            MsgBox.showWarning(ui, EASResource.getString(resourcePath, msg));
            SysUtil.abort();
        }
    }

    public static void verifyEmptyAndNoZero(CoreUIObject ui, KDFormattedTextField txt)
    {
        verifyEmpty(ui, txt);
        BigDecimal value = txt.getBigDecimalValue();
        if(value.compareTo(EcConstant.ZERO) == 0)
        {
            txt.requestFocus(true);
            String msg = (new StringBuilder()).append(getCompLabelText(txt)).append(EASResource.getString(path, "CanNotBeZero")).toString();
            MsgBox.showWarning(ui, msg);
            SysUtil.abort();
        }
    }

    public static void verifyBeginEndDateRel(CoreUIObject ui, Date beginDate, Date endDate)
    {
        if(beginDate != null && endDate != null && beginDate.after(endDate))
        {
            MsgBox.showWarning(ui, EASResource.getString(path, "beginDateNotGreaterEndDate"));
            SysUtil.abort();
        }
    }
    public static void verifyRequire(CoreUIObject ui)
    {
        Component comps[] = null;
        boolean isFocusPolicy = false;
        java.awt.FocusTraversalPolicy focusTraversalPolicy = ui.getFocusTraversalPolicy();
        if(focusTraversalPolicy instanceof UIFocusTraversalPolicy)
        {
            UIFocusTraversalPolicy policy = (UIFocusTraversalPolicy)focusTraversalPolicy;
            comps = policy.getComponents();
        }
        if(comps != null)
            isFocusPolicy = true;
        else
            comps = ui.getComponents();
        for(int i = 0; i < comps.length; i++)
        {
            Component comp = comps[i];
            if(!comp.isEnabled() || !isFocusPolicy && !(comp instanceof KDLabelContainer))
                continue;
            JComponent editor = null;
            if(isFocusPolicy)
            {
                editor = (JComponent)comp;
            } else
            {
                KDLabelContainer ct = (KDLabelContainer)comp;
                editor = ct.getBoundEditor();
            }
            if(editor == null)
                return;
            if(!editor.isEnabled())
                continue;
            KDTextArea txtEditor;
            KDTextField TextField;
            KDComboBox kDComboBox;
            KDDatePicker kDDatePicker;
            KDBizPromptBox kDBizPromptBox;
            KDFormattedTextField kDFormattedTextField;
            KDBizMultiLangBox kDBizMultiLangBox;
            if(editor instanceof KDTextField)
            {
            	TextField = (KDTextField)editor;
                if(TextField.isRequired())
                    verifyEmpty(ui, TextField);
                continue;
            }
            if(editor instanceof KDTextArea)
            {
                txtEditor = (KDTextArea)editor;
                if(txtEditor.isRequired())
                    verifyEmpty(ui, txtEditor);
                continue;
            }
            if(editor instanceof KDComboBox)
            {
            	kDComboBox = (KDComboBox)editor;
                if(kDComboBox.isRequired())
                    verifyEmpty(ui, kDComboBox);
                continue;
            }
            if(editor instanceof KDDatePicker)
            {
            	kDDatePicker = (KDDatePicker)editor;
                if(kDDatePicker.isRequired())
                    verifyEmpty(ui, kDDatePicker);
                continue;
            }
            if(editor instanceof KDBizPromptBox)
            {
            	kDBizPromptBox = (KDBizPromptBox)editor;
                if(kDBizPromptBox.isRequired())
                    verifyEmpty(ui, kDBizPromptBox);
                continue;
            }
            if(editor instanceof KDFormattedTextField)
            {
            	kDFormattedTextField = (KDFormattedTextField)editor;
                if(kDFormattedTextField.isRequired())
                    verifyEmpty(ui, kDFormattedTextField);
                continue;
            }
            if(!(editor instanceof KDBizMultiLangBox))
                continue;
            kDBizMultiLangBox = (KDBizMultiLangBox)editor;
            if(kDBizMultiLangBox.isRequired())
                verifyEmpty(ui, kDBizMultiLangBox);
        }

    }


    private static Set getAllComponents(Container container)
    {
        Component components[] = container.getComponents();
        Set compSet = new HashSet();
        int i = 0;
        for(int n = components.length; i < n; i++)
        {
            Component comp = components[i];
            compSet.add(comp);
            if(comp instanceof Container)
                compSet.addAll(getAllComponents((Container)comp));
        }

        return compSet;
    }

    public static void verifyUIControlEmpty(CoreUI ui)
    {
        Set allLeafComponents = getAllComponents(ui);
        Iterator it = allLeafComponents.iterator();
        do
        {
            if(!it.hasNext())
                break;
            Component comp = (Component)it.next();
            if(comp instanceof IKDTextComponent)
            {
                IKDTextComponent txtComp = (IKDTextComponent)comp;
                if(txtComp.isRequired() && comp.getName() != null)
                    if(comp instanceof KDTextField)
                        verifyEmpty(ui, (KDTextField)comp);
                    else
                    if(comp instanceof KDBizPromptBox)
                        verifyEmpty(ui, (KDBizPromptBox)comp);
                    else
                    if(comp instanceof KDComboBox)
                        verifyEmpty(ui, (KDComboBox)comp);
                    else
                    if(comp instanceof KDMultiLangBox)
                        verifyEmpty(ui, (KDMultiLangBox)comp);
                    else
                    if(comp instanceof KDDatePicker)
                        verifyEmpty(ui, (KDDatePicker)comp);
                    else
                    if(comp instanceof KDFormattedTextField)
                        verifyEmpty(ui, (KDFormattedTextField)comp);
                    else
                    if(comp instanceof KDTextArea)
                        verifyEmpty(ui, (KDTextArea)comp);
            }
        } while(true);
    }

    public static void verifyRequire(KDTable kdtEntries, boolean requireRow)
    {
        verifyRequire(kdtEntries, "\u5206\u5F55", requireRow);
    }

    /**
     * @deprecated Method verifyRequire is deprecated
     */

    public static void verifyRequire(KDTable kdtEntries, String title, boolean requireRow)
    {
        if(requireRow && kdtEntries.getRowCount() == 0)
        {
            MsgBox.showWarning((new StringBuilder()).append("\u8BF7\u5728").append(title).append("\u4E2D\u5F55\u5165\u81F3\u5C11\u4E00\u884C").toString());
            SysUtil.abort();
        }
        for(int i = 0; i < kdtEntries.getRowCount(); i++)
        {
            for(int j = 0; j < kdtEntries.getColumnCount(); j++)
                if(kdtEntries.getColumn(j).isRequired() && kdtEntries.getValueAt(i, j) == null)
                {
                    String header = (String)kdtEntries.getHead().getRow(kdtEntries.getHeadRowCount() - 1).getCell(j).getValue();
                    kdtEntries.getEditManager().editCellAt(i, j);
                    MsgBox.showWarning((new StringBuilder()).append(header).append(" \u4E0D\u80FD\u4E3A\u7A7A").toString());
                    SysUtil.abort();
                }

        }

    }

    public static void verifyRequire(CoreUIObject ui, KDTable kdtEntries, String title, boolean requireRow)
    {
        if(requireRow && kdtEntries.getRowCount() == 0)
        {
            MsgBox.showWarning((new StringBuilder()).append("\u8BF7\u5728").append(title).append("\u4E2D\u5F55\u5165\u81F3\u5C11\u4E00\u884C").toString());
            SysUtil.abort();
        }
        for(int i = 0; i < kdtEntries.getRowCount(); i++)
        {
            for(int j = 0; j < kdtEntries.getColumnCount(); j++)
                if(kdtEntries.getColumn(j).isRequired() && kdtEntries.getValueAt(i, j) == null)
                {
                    String header = (String)kdtEntries.getHead().getRow(kdtEntries.getHeadRowCount() - 1).getCell(j).getValue();
                    kdtEntries.getEditManager().editCellAt(i, j);
                    MsgBox.showWarning((new StringBuilder()).append(title).append("-").append(header).append(" \u4E0D\u80FD\u4E3A\u7A7A").toString());
                    SysUtil.abort();
                }

        }

    }



    public static void verifyTableCoulmnValueIsSame(CoreUIObject ui, KDTable table, IRow row, String key, Object value, boolean isSame)
    {
        String headName = EcTableHelper.getHeadName(table, key);
        String warning = null;
        if(isSame)
            warning = (new StringBuilder()).append(headName).append(" \u5FC5\u987B\u76F8\u540C").toString();
        else
            warning = (new StringBuilder()).append(headName).append(" \u5FC5\u987B\u4E0D\u540C").toString();
    }

    public static void verifyTableCoulmnValueDup(CoreUIObject ui, KDTable table)
    {
        if(EcTableHelper.isEmpty(table))
        {
            return;
        } else
        {
            String keyArr[] = EcTableHelper.getColumnKeys(table);
            verifyTableCoulmnValueDup(ui, table, keyArr);
            return;
        }
    }

    public static void verifyTableCoulmnValueDup(CoreUIObject ui, KDTable table, String keyArr[])
    {
        if(EcTableHelper.isEmpty(table) || EcArrayUtil.isEmpty(keyArr))
            return;
        String key = null;
        int i = 0;
        for(int length = keyArr.length; i < length; i++)
        {
            key = keyArr[i];
            verifyTableCoulmnValueDup(ui, table, key);
        }

    }

    public static void verifyTableCoulmnValueDup(CoreUIObject ui, KDTable table, String key)
    {
        if(EcTableHelper.isEmpty(table) || null == table.getColumn(key))
        {
            return;
        } else
        {
            String headName = EcTableHelper.getHeadName(table, key);
            String warning = (new StringBuilder()).append(headName).append("\u4E0D\u80FD\u91CD\u590D").toString();
            verifyTableCoulmnValueDup(ui, table, key, warning);
            return;
        }
    }

    public static void verifyTableCoulmnValueDup(CoreUIObject ui, KDTable table, String key, String warning)
    {
        if(EcTableHelper.isEmpty(table) || null == table.getColumn(key))
            return;
        Map valueMap = new HashMap();
        int rowIndex = -1;
        int colIndex = table.getColumnIndex(key);
        IRow row = null;
        ICell cell = null;
        Object value = null;
        int i = 0;
        for(int rowCount = table.getRowCount(); i < rowCount; i++)
        {
            row = table.getRow(i);
            cell = row.getCell(key);
            value = cell.getValue();
            rowIndex = row.getRowIndex();
            if(!EcStringHelper.isEmpty(value) && valueMap.containsValue(value))
            {
                MsgBox.showWarning(ui, warning);
                table.getEditManager().editCellAt(rowIndex, colIndex);
                SysUtil.abort();
            }
            valueMap.put(Integer.valueOf(rowIndex), value);
        }

    }

    public static void verifyIsGreaterThan(CoreUIObject ui, KDFormattedTextField kdfTextField1, String label1, KDFormattedTextField kdfTextField2, String label2, boolean isIgnoreNull)
    {
        verifyMathOperate(ui, kdfTextField1, label1, kdfTextField2, label2, isIgnoreNull, CompareTypeEnum.GREATE);
    }

    public static void verifyIsLessThan(CoreUIObject ui, KDFormattedTextField kdfTextField1, String label1, KDFormattedTextField kdfTextField2, String label2, boolean isIgnoreNull)
    {
        verifyMathOperate(ui, kdfTextField1, label1, kdfTextField2, label2, isIgnoreNull, CompareTypeEnum.LITTE);
    }

    public static void verifyIsEqual(CoreUIObject ui, KDFormattedTextField kdfTextField1, String label1, KDFormattedTextField kdfTextField2, String label2, boolean isIgnoreNull)
    {
        verifyMathOperate(ui, kdfTextField1, label1, kdfTextField2, label2, isIgnoreNull, CompareTypeEnum.EQUAL);
    }

    public static void verifyIsGreaterThan(CoreUIObject ui, KDFormattedTextField kdfTextField1, KDFormattedTextField kdfTextField2, boolean isIgnoreNull)
    {
        String label1 = getCompLabelText(kdfTextField1);
        String label2 = getCompLabelText(kdfTextField2);
        verifyIsGreaterThan(ui, kdfTextField1, label1, kdfTextField2, label2, isIgnoreNull);
    }

    public static void verifyIsLessThan(CoreUIObject ui, KDFormattedTextField kdfTextField1, KDFormattedTextField kdfTextField2, boolean isIgnoreNull)
    {
        String label1 = getCompLabelText(kdfTextField1);
        String label2 = getCompLabelText(kdfTextField2);
        verifyIsLessThan(ui, kdfTextField1, label1, kdfTextField2, label2, isIgnoreNull);
    }

    public static void verifyIsEqual(CoreUIObject ui, KDFormattedTextField kdfTextField1, KDFormattedTextField kdfTextField2, boolean isIgnoreNull)
    {
        String label1 = getCompLabelText(kdfTextField1);
        String label2 = getCompLabelText(kdfTextField2);
        verifyIsEqual(ui, kdfTextField1, label1, kdfTextField2, label2, isIgnoreNull);
    }

    public static void verifyIsGreaterThan(CoreUIObject ui, KDFormattedTextField kdfTextField, String label, Object compareValue, String compareLabel, boolean isIgnoreNull)
    {
        verifyMathOperate(ui, kdfTextField, label, compareValue, compareLabel, isIgnoreNull, CompareTypeEnum.GREATE);
    }

    public static void verifyIsLessThan(CoreUIObject ui, KDFormattedTextField kdfTextField, String label, Object compareValue, String compareLabel, boolean isIgnoreNull)
    {
        verifyMathOperate(ui, kdfTextField, label, compareValue, compareLabel, isIgnoreNull, CompareTypeEnum.LITTE);
    }

    public static void verifyIsEqual(CoreUIObject ui, KDFormattedTextField kdfTextField, String label, Object compareValue, String compareLabel, boolean isIgnoreNull)
    {
        verifyMathOperate(ui, kdfTextField, label, compareValue, compareLabel, isIgnoreNull, CompareTypeEnum.EQUAL);
    }

    public static void verifyIsGreaterThan(CoreUIObject ui, KDFormattedTextField kdfTextField, Object compareValue, boolean isIgnoreNull)
    {
        String label = getCompLabelText(kdfTextField);
        String compareLabel = null == compareValue ? null : compareValue.toString();
        verifyIsGreaterThan(ui, kdfTextField, label, compareValue, compareLabel, isIgnoreNull);
    }

    public static void verifyIsLessThan(CoreUIObject ui, KDFormattedTextField kdfTextField, Object compareValue, boolean isIgnoreNull)
    {
        String label = getCompLabelText(kdfTextField);
        String compareLabel = null == compareValue ? null : compareValue.toString();
        verifyIsLessThan(ui, kdfTextField, label, compareValue, compareLabel, isIgnoreNull);
    }

    public static void verifyIsEqual(CoreUIObject ui, KDFormattedTextField kdfTextField, Object compareValue, boolean isIgnoreNull)
    {
        String label = getCompLabelText(kdfTextField);
        String compareLabel = null == compareValue ? null : compareValue.toString();
        verifyIsEqual(ui, kdfTextField, label, compareValue, compareLabel, isIgnoreNull);
    }

    public static void verifyIsGreaterThan(CoreUIObject ui, KDTable table, IRow row, String key, String label, Object compareValue, String compareLabel, boolean isIgnoreNull)
    {
        verifyMathOperate(ui, table, row, key, label, compareValue, compareLabel, isIgnoreNull, CompareTypeEnum.GREATE);
    }

    public static void verifyIsLessThan(CoreUIObject ui, KDTable table, IRow row, String key, String label, Object compareValue, String compareLabel, boolean isIgnoreNull)
    {
        verifyMathOperate(ui, table, row, key, label, compareValue, compareLabel, isIgnoreNull, CompareTypeEnum.LITTE);
    }

    public static void verifyIsEqual(CoreUIObject ui, KDTable table, IRow row, String key, String label, Object compareValue, String compareLabel, boolean isIgnoreNull)
    {
        verifyMathOperate(ui, table, row, key, label, compareValue, compareLabel, isIgnoreNull, CompareTypeEnum.EQUAL);
    }

    public static void verifyIsGreaterThan(CoreUIObject ui, KDTable table, IRow row, String key, Object compareValue, boolean isIgnoreNull)
    {
        String label = EcTableHelper.getHeadName(table, key);
        String compareLabel = null == compareValue ? null : compareValue.toString();
        verifyIsGreaterThan(ui, table, row, key, label, compareValue, compareLabel, isIgnoreNull);
    }

    public static void verifyIsLessThan(CoreUIObject ui, KDTable table, IRow row, String key, Object compareValue, boolean isIgnoreNull)
    {
        String label = EcTableHelper.getHeadName(table, key);
        String compareLabel = null == compareValue ? null : compareValue.toString();
        verifyIsLessThan(ui, table, row, key, label, compareValue, compareLabel, isIgnoreNull);
    }

    public static void verifyIsEqual(CoreUIObject ui, KDTable table, IRow row, String key, Object compareValue, boolean isIgnoreNull)
    {
        String label = EcTableHelper.getHeadName(table, key);
        String compareLabel = null == compareValue ? null : compareValue.toString();
        verifyIsEqual(ui, table, row, key, label, compareValue, compareLabel, isIgnoreNull);
    }

    public static void verifyIsGreaterThan(CoreUIObject ui, KDTable table, IRow row, String key1, String key2, boolean isIgnoreNull)
    {
        String label1 = EcTableHelper.getHeadName(table, key1);
        String label2 = EcTableHelper.getHeadName(table, key2);
        verifyIsGreaterThan(ui, table, row, key1, label1, key2, label2, isIgnoreNull);
    }

    public static void verifyIsLessThan(CoreUIObject ui, KDTable table, IRow row, String key1, String key2, boolean isIgnoreNull)
    {
        String label1 = EcTableHelper.getHeadName(table, key1);
        String label2 = EcTableHelper.getHeadName(table, key2);
        verifyIsLessThan(ui, table, row, key1, label1, key2, label2, isIgnoreNull);
    }

    public static void verifyIsEqual(CoreUIObject ui, KDTable table, IRow row, String key1, String key2, boolean isIgnoreNull)
    {
        String label1 = EcTableHelper.getHeadName(table, key1);
        String label2 = EcTableHelper.getHeadName(table, key2);
        verifyIsEqual(ui, table, row, key1, label1, key2, label2, isIgnoreNull);
    }

    public static void verifyIsGreaterThan(CoreUIObject ui, KDTable table, String key1, String label1, String key2, String label2, boolean isIgnoreNull)
    {
        int colIndex1 = table.getColumnIndex(key1);
        int colIndex2 = table.getColumnIndex(key2);
        IRow row = null;
        int i = 0;
        for(int rowCount = table.getRowCount(); i < rowCount; i++)
        {
            row = table.getRow(i);
            verifyMathOperate(ui, table, row, colIndex1, label1, colIndex2, label2, isIgnoreNull, CompareTypeEnum.GREATE);
        }

    }

    public static void verifyIsLessThan(CoreUIObject ui, KDTable table, String key1, String label1, String key2, String label2, boolean isIgnoreNull)
    {
        int colIndex1 = table.getColumnIndex(key1);
        int colIndex2 = table.getColumnIndex(key2);
        IRow row = null;
        int i = 0;
        for(int rowCount = table.getRowCount(); i < rowCount; i++)
        {
            row = table.getRow(i);
            verifyMathOperate(ui, table, row, colIndex1, label1, colIndex2, label2, isIgnoreNull, CompareTypeEnum.LITTE);
        }

    }

    public static void verifyIsEqual(CoreUIObject ui, KDTable table, String key1, String label1, String key2, String label2, boolean isIgnoreNull)
    {
        int colIndex1 = table.getColumnIndex(key1);
        int colIndex2 = table.getColumnIndex(key2);
        IRow row = null;
        int i = 0;
        for(int rowCount = table.getRowCount(); i < rowCount; i++)
        {
            row = table.getRow(i);
            verifyMathOperate(ui, table, row, colIndex1, label1, colIndex2, label2, isIgnoreNull, CompareTypeEnum.EQUAL);
        }

    }

    public static void verifyIsGreaterThan(CoreUIObject ui, KDTable table, String key1, String key2, boolean isIgnoreNull)
    {
        String label1 = EcTableHelper.getHeadName(table, key1);
        String label2 = EcTableHelper.getHeadName(table, key2);
        verifyIsGreaterThan(ui, table, key1, label1, key2, label2, isIgnoreNull);
    }

    public static void verifyIsLessThan(CoreUIObject ui, KDTable table, String key1, String key2, boolean isIgnoreNull)
    {
        String label1 = EcTableHelper.getHeadName(table, key1);
        String label2 = EcTableHelper.getHeadName(table, key2);
        verifyIsLessThan(ui, table, key1, label1, key2, label2, isIgnoreNull);
    }

    public static void verifyIsEqual(CoreUIObject ui, KDTable table, String key1, String key2, boolean isIgnoreNull)
    {
        String label1 = EcTableHelper.getHeadName(table, key1);
        String label2 = EcTableHelper.getHeadName(table, key2);
        verifyIsEqual(ui, table, key1, label1, key2, label2, isIgnoreNull);
    }

    public static void verifyIsGreaterThan(CoreUIObject ui, KDTable table, String key, String label, Object compareValue, String compareLabel, boolean isIgnoreNull)
    {
        int colIndex = table.getColumnIndex(key);
        IRow row = null;
        int i = 0;
        for(int rowCount = table.getRowCount(); i < rowCount; i++)
        {
            row = table.getRow(i);
            verifyMathOperate(ui, table, row, colIndex, label, compareValue, compareLabel, isIgnoreNull, CompareTypeEnum.GREATE);
        }

    }

    public static void verifyIsLessThan(CoreUIObject ui, KDTable table, String key, String label, Object compareValue, String compareLabel, boolean isIgnoreNull)
    {
        int colIndex = table.getColumnIndex(key);
        IRow row = null;
        int i = 0;
        for(int rowCount = table.getRowCount(); i < rowCount; i++)
        {
            row = table.getRow(i);
            verifyMathOperate(ui, table, row, colIndex, label, compareValue, compareLabel, isIgnoreNull, CompareTypeEnum.LITTE);
        }

    }

    public static void verifyIsEqual(CoreUIObject ui, KDTable table, String key, String label, Object compareValue, String compareLabel, boolean isIgnoreNull)
    {
        int colIndex = table.getColumnIndex(key);
        IRow row = null;
        int i = 0;
        for(int rowCount = table.getRowCount(); i < rowCount; i++)
        {
            row = table.getRow(i);
            verifyMathOperate(ui, table, row, colIndex, label, compareValue, compareLabel, isIgnoreNull, CompareTypeEnum.EQUAL);
        }

    }

    public static void verifyIsGreaterThan(CoreUIObject ui, KDTable table, String key, Object compareValue, boolean isIgnoreNull)
    {
        String label = EcTableHelper.getHeadName(table, key);
        String compareLabel = null == compareValue ? null : compareValue.toString();
        verifyIsGreaterThan(ui, table, key, label, compareValue, compareLabel, isIgnoreNull);
    }

    public static void verifyIsLessThan(CoreUIObject ui, KDTable table, String key, Object compareValue, boolean isIgnoreNull)
    {
        String label = EcTableHelper.getHeadName(table, key);
        String compareLabel = null == compareValue ? null : compareValue.toString();
        verifyIsLessThan(ui, table, key, label, compareValue, compareLabel, isIgnoreNull);
    }

    public static void verifyIsEqual(CoreUIObject ui, KDTable table, String key, Object compareValue, boolean isIgnoreNull)
    {
        String label = EcTableHelper.getHeadName(table, key);
        String compareLabel = null == compareValue ? null : compareValue.toString();
        verifyIsEqual(ui, table, key, label, compareValue, compareLabel, isIgnoreNull);
    }



    public static void verifyMathOperate(CoreUIObject ui, KDFormattedTextField kdfTextField1, String label1, KDFormattedTextField kdfTextField2, String label2, boolean isIgnoreNull, CompareTypeEnum compareTypeEnum)
    {
        boolean flag = false;
        BigDecimal value1 = kdfTextField1.getBigDecimalValue();
        BigDecimal value2 = kdfTextField2.getBigDecimalValue();
        if(isIgnoreNull && (null == value1 || null == value2))
            return;
        if(CompareTypeEnum.GREATE.equals(compareTypeEnum))
            flag = EcNumberHelper.isGreaterThan(value1, value2);
        else
        if(CompareTypeEnum.LITTE.equals(compareTypeEnum))
            flag = EcNumberHelper.isLessThan(value1, value2);
        else
        if(CompareTypeEnum.EQUAL.equals(compareTypeEnum))
            flag = EcNumberHelper.isEqual(value1, value2);
        if(flag)
        {
            String compareAlias = compareTypeEnum.getAlias();
            String msg = (new StringBuilder()).append(label1).append(" ").append(compareAlias).append(" ").append(label2).toString();
            if(kdfTextField1.isEnabled())
                kdfTextField1.requestFocus(true);
            else
                kdfTextField2.requestFocus(true);
            MsgBox.showWarning(ui, msg);
            SysUtil.abort();
        }
    }

    public static void verifyMathOperate(CoreUIObject ui, KDFormattedTextField kdfTextField1, KDFormattedTextField kdfTextField2, boolean isIgnoreNull, CompareTypeEnum compareTypeEnum)
    {
        String label1 = getCompLabelText(kdfTextField1);
        String label2 = getCompLabelText(kdfTextField1);
        verifyMathOperate(ui, kdfTextField1, label1, kdfTextField2, label2, isIgnoreNull, compareTypeEnum);
    }

    public static void verifyMathOperate(CoreUIObject ui, KDFormattedTextField kdfTextField, String label, Object compareValue, String compareLabel, boolean isIgnoreNull, CompareTypeEnum compareTypeEnum)
    {
        boolean flag = false;
        BigDecimal value = kdfTextField.getBigDecimalValue();
        if(isIgnoreNull && (null == value || null == compareValue))
            return;
        if(CompareTypeEnum.GREATE.equals(compareTypeEnum))
            flag = EcNumberHelper.isGreaterThan(value, compareValue);
        else
        if(CompareTypeEnum.LITTE.equals(compareTypeEnum))
            flag = EcNumberHelper.isLessThan(value, compareValue);
        else
        if(CompareTypeEnum.EQUAL.equals(compareTypeEnum))
            flag = EcNumberHelper.isEqual(value, compareValue);
        if(flag)
        {
            String compareAlias = compareTypeEnum.getAlias();
            String msg = (new StringBuilder()).append(label).append(" ").append(compareAlias).append(" ").append(compareLabel).toString();
            kdfTextField.requestFocus(true);
            MsgBox.showWarning(ui, msg);
            SysUtil.abort();
        }
    }

    public static void verifyMathOperate(CoreUIObject ui, KDFormattedTextField kdfTextField, Object compareValue, boolean isIgnoreNull, CompareTypeEnum compareTypeEnum)
    {
        String label = getCompLabelText(kdfTextField);
        String compareLabel = getCompLabelText(kdfTextField);
        verifyMathOperate(ui, kdfTextField, label, compareValue, compareLabel, isIgnoreNull, compareTypeEnum);
    }

    private static void verifyMathOperate(CoreUIObject ui, KDTable table, IRow row, int colIndex1, String label1, int colIndex2, String label2, boolean isIgnoreNull, 
            CompareTypeEnum compareTypeEnum)
    {
        boolean flag = false;
        Object value1 = row.getCell(colIndex1).getValue();
        Object value2 = row.getCell(colIndex2).getValue();
        if(isIgnoreNull && (null == value1 || null == value2))
            return;
        if(CompareTypeEnum.GREATE.equals(compareTypeEnum))
            flag = EcNumberHelper.isGreaterThan(value1, value2);
        else
        if(CompareTypeEnum.LITTE.equals(compareTypeEnum))
            flag = EcNumberHelper.isLessThan(value1, value2);
        else
        if(CompareTypeEnum.EQUAL.equals(compareTypeEnum))
            flag = EcNumberHelper.isEqual(value1, value2);
        if(flag)
        {
            KDTEditManager editManager = table.getEditManager();
            String compareAlias = compareTypeEnum.getAlias();
            String msg = (new StringBuilder()).append(label1).append(" ").append(compareAlias).append(" ").append(label2).toString();
            int rowIndex = row.getRowIndex();
            int colIndex = colIndex1;
            int rs = editManager.editCellAt(rowIndex, colIndex);
            if(rs == 3)
            {
                colIndex = colIndex2;
                editManager.editCellAt(rowIndex, colIndex);
            }
            MsgBox.showWarning(ui, msg);
            SysUtil.abort();
        }
    }

    private static void verifyMathOperate(CoreUIObject ui, KDTable table, IRow row, int colIndex, String label, Object compareValue, String compareLabel, boolean isIgnoreNull, 
            CompareTypeEnum compareTypeEnum)
    {
        boolean flag = false;
        Object value = row.getCell(colIndex).getValue();
        if(isIgnoreNull && (null == value || null == compareValue))
            return;
        if(CompareTypeEnum.GREATE.equals(compareTypeEnum))
            flag = EcNumberHelper.isGreaterThan(value, compareValue);
        else
        if(CompareTypeEnum.LITTE.equals(compareTypeEnum))
            flag = EcNumberHelper.isLessThan(value, compareValue);
        else
        if(CompareTypeEnum.EQUAL.equals(compareTypeEnum))
            flag = EcNumberHelper.isEqual(value, compareValue);
        if(flag)
        {
            KDTEditManager editManager = table.getEditManager();
            String compareAlias = compareTypeEnum.getAlias();
            String msg = (new StringBuilder()).append(label).append(" ").append(compareAlias).append(" ").append(compareLabel).toString();
            int rowIndex = row.getRowIndex();
            editManager.editCellAt(rowIndex, colIndex);
            MsgBox.showWarning(ui, msg);
            SysUtil.abort();
        }
    }

    public static void verifyMathOperate(CoreUIObject ui, KDTable table, IRow row, String key1, String label1, String key2, String label2, boolean isIgnoreNull, 
            CompareTypeEnum compareTypeEnum)
    {
        int colIndex1 = row.getCell(key1).getColumnIndex();
        int colIndex2 = row.getCell(key2).getColumnIndex();
        verifyMathOperate(ui, table, row, colIndex1, label1, colIndex2, label2, isIgnoreNull, compareTypeEnum);
    }

    public static void verifyMathOperate(CoreUIObject ui, KDTable table, String key1, String label1, String key2, String label2, boolean isIgnoreNull, CompareTypeEnum compareTypeEnum)
    {
        int colIndex1 = table.getColumnIndex(key1);
        int colIndex2 = table.getColumnIndex(key2);
        IRow row = null;
        int i = 0;
        for(int rowCount = table.getRowCount(); i < rowCount; i++)
        {
            row = table.getRow(i);
            verifyMathOperate(ui, table, row, colIndex1, label1, colIndex2, label2, isIgnoreNull, compareTypeEnum);
        }

    }

    public static void verifyMathOperate(CoreUIObject ui, KDTable table, IRow row, String key1, String key2, boolean isIgnoreNull, CompareTypeEnum compareTypeEnum)
    {
        String label1 = EcTableHelper.getHeadName(table, key1);
        String label2 = EcTableHelper.getHeadName(table, key2);
        verifyMathOperate(ui, table, row, key1, label1, key2, label2, isIgnoreNull, compareTypeEnum);
    }

    public static void verifyMathOperate(CoreUIObject ui, KDTable table, String key1, String key2, boolean isIgnoreNull, CompareTypeEnum compareTypeEnum)
    {
        String label1 = EcTableHelper.getHeadName(table, key1);
        String label2 = EcTableHelper.getHeadName(table, key2);
        verifyMathOperate(ui, table, key1, label1, key2, label2, isIgnoreNull, compareTypeEnum);
    }

    public static void verifyMathOperate(CoreUIObject ui, KDTable table, IRow row, String key, String label, Object compareValue, String compareLabel, boolean isIgnoreNull, 
            CompareTypeEnum compareTypeEnum)
    {
        int colIndex = row.getCell(key).getColumnIndex();
        verifyMathOperate(ui, table, row, colIndex, label, compareValue, compareLabel, isIgnoreNull, compareTypeEnum);
    }

    public static void verifyMathOperate(CoreUIObject ui, KDTable table, String key, String label, Object compareValue, String compareLabel, boolean isIgnoreNull, CompareTypeEnum compareTypeEnum)
    {
        int colIndex = table.getColumnIndex(key);
        IRow row = null;
        int i = 0;
        for(int rowCount = table.getRowCount(); i < rowCount; i++)
        {
            row = table.getRow(i);
            verifyMathOperate(ui, table, row, colIndex, label, compareValue, compareLabel, isIgnoreNull, compareTypeEnum);
        }

    }

    public static void verifyMathOperate(CoreUIObject ui, KDTable table, IRow row, String key, Object compareValue, boolean isIgnoreNull, CompareTypeEnum compareTypeEnum)
    {
        String label = EcTableHelper.getHeadName(table, key);
        String compareLabel = null == compareValue ? null : compareValue.toString();
        verifyMathOperate(ui, table, row, key, label, compareValue, compareLabel, isIgnoreNull, compareTypeEnum);
    }

    public static void verifyMathOperate(CoreUIObject ui, KDTable table, String key, Object compareValue, boolean isIgnoreNull, CompareTypeEnum compareTypeEnum)
    {
        String label = EcTableHelper.getHeadName(table, key);
        String compareLabel = null == compareValue ? null : compareValue.toString();
        verifyMathOperate(ui, table, key, label, compareValue, compareLabel, isIgnoreNull, compareTypeEnum);
    }

    public static void checkSelected(Component comp, KDTable table)
    {
        if(table.getRowCount() == 0 || table.getSelectManager().size() == 0)
        {
            MsgBox.showWarning(comp, EASResource.getString("com.kingdee.eas.framework.FrameWorkResource.Msg_MustSelected"));
            SysUtil.abort();
        }
    }

    private static String path = "com.kingdee.eas.fm.common.FMResource";
    private static final BigDecimal MAX_VALUE = new BigDecimal("9999999999999.99");

}


/*
	DECOMPILATION REPORT

	Decompiled from: F:\qs\lib\client\industry\ec_common-client.jar
	Total time: 63 ms
	Jad reported messages/errors:
	Exit status: 0
	Caught exceptions:
*/